package com.cc.visitor.enums;

/**
 * @author chanchaw
 * @create 2024-10-06 14:58
 */
public enum VisitProgress {
    WAIT_AUDITED(0,"待审核","访客制作访单后等待受访者审核"),AUDITED(1,"待进场","受访者审核后等待访客进场"),
    ENTER(2,"已进场","访客已扫码进场"),OUT(3,"已完成","访客结束行程已离场"),
    REJECT(-1,"已驳回","受访者已驳回访单"),
    ;
    private int id;
    private String sid;
    private String remark;
    public int getId() {return id;}
    public String getSid() {return sid;}
    public String getRemark() {return remark;}

    VisitProgress(int id,String sid, String remark) {
        this.id = id;
        this.sid = sid;
        this.remark = remark;
    }

    // 根据索引返回枚举值
    public static VisitProgress ofid(int id){
        for(VisitProgress item:VisitProgress.values()){
            if(item.getId() == id) return item;
        }
        return null;
    }

    public static VisitProgress ofsid(String sid){
        for(VisitProgress item:VisitProgress.values()){
            if(item.getSid().equals(sid)) return item;
        }
        return null;
    }
}
